3.2456 \(\int \frac{a+b x^n}{x^2} \, dx\)

Optimal. Leaf size=22 \[ -\frac{a}{x}-\frac{b x^{n-1}}{1-n} \]

[Out]

-(a/x) - (b*x^(-1 + n))/(1 - n)

________________________________________________________________________________________

Rubi [A]  time = 0.0087256, antiderivative size = 22, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 1, integrand size = 11, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.091, Rules used = {14} \[ -\frac{a}{x}-\frac{b x^{n-1}}{1-n} \]

Antiderivative was successfully verified.

[In]

Int[(a + b*x^n)/x^2,x]

[Out]

-(a/x) - (b*x^(-1 + n))/(1 - n)

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rubi steps

\begin{align*} \int \frac{a+b x^n}{x^2} \, dx &=\int \left (\frac{a}{x^2}+b x^{-2+n}\right ) \, dx\\ &=-\frac{a}{x}-\frac{b x^{-1+n}}{1-n}\\ \end{align*}

Mathematica [A]  time = 0.0099266, size = 22, normalized size = 1. \[ -\frac{a}{x}-\frac{b x^{n-1}}{1-n} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*x^n)/x^2,x]

[Out]

-(a/x) - (b*x^(-1 + n))/(1 - n)

________________________________________________________________________________________

Maple [A]  time = 0.007, size = 21, normalized size = 1. \begin{align*}{\frac{1}{x} \left ({\frac{b{{\rm e}^{n\ln \left ( x \right ) }}}{-1+n}}-a \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*x^n)/x^2,x)

[Out]

(b/(-1+n)*exp(n*ln(x))-a)/x

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*x^n)/x^2,x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 1.00154, size = 43, normalized size = 1.95 \begin{align*} -\frac{a n - b x^{n} - a}{{\left (n - 1\right )} x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*x^n)/x^2,x, algorithm="fricas")

[Out]

-(a*n - b*x^n - a)/((n - 1)*x)

________________________________________________________________________________________

Sympy [A]  time = 0.393397, size = 32, normalized size = 1.45 \begin{align*} \begin{cases} - \frac{a n}{n x - x} + \frac{a}{n x - x} + \frac{b x^{n}}{n x - x} & \text{for}\: n \neq 1 \\- \frac{a}{x} + b \log{\left (x \right )} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*x**n)/x**2,x)

[Out]

Piecewise((-a*n/(n*x - x) + a/(n*x - x) + b*x**n/(n*x - x), Ne(n, 1)), (-a/x + b*log(x), True))

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{b x^{n} + a}{x^{2}}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*x^n)/x^2,x, algorithm="giac")

[Out]

integrate((b*x^n + a)/x^2, x)